#include <iostream>

#include "comm.hpp"

int main() {
  // 客户端
  int fd = open(PIPEFILE, O_WRONLY);
  if (fd < 0) {
    cerr << "CLIENT OPEN PIPE FAIL" << endl;
    exit(FIFO_OPEN_ERR);
  }
  cout << "Client open file done" << endl;
  string line;
  while (true) {
    cout << "Please Enter Your Massage@ ";
    getline(cin, line);
    write(fd, line.c_str(), line.size());
  }
  close(fd);
  return 0;
}
